#include "Analyzer.h"
#include "Parser.h"
#include "InputLine.h"

#include <iostream>

using namespace std;

int main(){
	Analyzer checker;
	string nothing;
	Token tok;
	Parser p;
	Analyzer::setStaticArrays();
	string filename;

	try{
		cout << "enter file name to parse: ";
		cin >> filename;

		InputLine in;

		p.setFile(filename);
		p.setInputLine(&in);

		if(p.isParserReady()){
			cout << "parsing started...\n";		
			
			cout << checker.analyze(p);	
		
		} else {
			cout << "bad parser\n";
		}


	}
	catch(string s){
		cout << s;
	}
	catch(...){
		cout << "Error occured\n";
	}
	return 1;
}